A digital photographing device may comprise a camera module, which in turn may comprise an image detector and an autofocus unit. The image detector may be arranged to capture an image of an object, and the autofocus unit may be configured to adjust a distance between a lens and a detector array until a sharp image can be attained. The image detector may be configured to provide image data for the autofocus unit. The autofocus unit may be configured to calculate a sharpness parameter, which indicates the sharpness of the image. The sharpness parameter may be e.g. a value of a modulation transfer function (MTF). The sharpness parameter may be calculated based on the image data provided by the image detector.
Auto focusing (AF) may be performed so that a command to move the lens is transmitted from a host to the camera module. During an auto-focus algorithm, the sharpness of the image may be analyzed each time when a movement of the lens has been completed. The lens may be moved in a stepwise fashion until a predetermined value of the sharpness parameter is attained, i.e. until the image is sharp enough. The lens may be moved by a focusing actuator, which may be e.g. a motor. The autofocus unit may be configured to drive said actuator. The distance between the lens and the image detector may be increased and/or decreased until the image is in its sharpest form.
The operation of a camera module may be controlled by a control unit (host) of a mobile device. In particular, the timing of operations of the focusing actuator may be controlled by the control unit of the mobile device. Different camera modules used in mobile devices are typically controlled in different ways. Thus, controlling software (SW) needs to be re-programmed when a camera module is replaced with a different one. Hardware features and software features of different camera modules are usually so different that interoperability and compatibility are often difficult or impossible to realize.